#include "game_thread.h"

volatile sig_atomic_t g_thread_run = 1;

extern void *thread_send_kafka(void *p);
extern void *thread_recv_kafka(void *p);	

void create_thread(pthread_t *thread, void *(*start_routine)(void *), void *arg)
{
	if (pthread_create(thread, NULL, start_routine, arg))
	{
		fprintf(stderr, "Create thread failed");
		exit(1);
	}
}

// void wakeup(struct monitor *m, int busy)
// {
// 	// if (m->sleep >= m->count - busy) {
// 	// 	// signal sleep worker, "spurious wakeup" is harmless
// 	// 	pthread_cond_signal(&m->cond);
// 	// }
// }
// static volatile int SIG = 0;
// void handle_hup(int signal)
// {
// 	if (signal == SIGHUP)
// 	{
// 		SIG = 1;
// 	}
// }
